import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../view/Login'
import Register from '../view/Register'
import Notification from '../view/Notification'
import Home from '../view/Home'
import RtcPrivateVideo from "@/components/rtc/RtcPrivateVideo.vue";

// Install router
Vue.use(VueRouter);

export default new VueRouter({
    routes: [{
        path: "/",
        redirect: "/login"
    },
        {
            name: "Login",
            path: '/login',
            component: Login
        },
        {
            name: "Register",
            path: '/register',
            component: Register
        },
        {
            name: "Notification",
            path: '/congratulate',
            component: Notification
        },
        // Purpose: Test
        {
            name: "RtcVideo",
            path: '/rtc',
            component: RtcPrivateVideo
        },
        {
            name: "Home",
            path: '/home',
            component: Home,
            children: [
                {
                    name: "Chat",
                    path: "/home/chat",
                    component: () => import("../view/Chat"),
                },
                {
                    name: "Contacts",
                    path: "/home/contacts",
                    component: () => import("../view/Contacts"),
                },
                {
                    name: "Profile",
                    path: "/home/profile",
                    component: () => import("../view/Profile"),
                },
                {
                    name: "More",
                    path: "/home/more",
                    component: () => import("../view/More"),
                },
                {
                    name: "Friend",
                    path: "/home/friend",
                    component: () => import("../view/Friend"),
                },
                {
                    name: "GROUP",
                    path: "/home/group",
                    component: () => import("../view/Group"),
                }
                // /home/profile  /home/more
            ]
        },
        {
            name: "AddFriend",
            path: '/add-friend',
            component: () => import("../view/AddFriend"),
        },
        {
            name: "FriendInfo",
            path: '/friend-info',
            component: () => import("../view/FriendInfo"),
        },
        // {
        //     name: "GroupInfo",
        //     path: '/group-info',
        //     component: () => import("../view/GroupInfo"),
        // },
        // {
        //     name: "ChatConversation",
        //     path: '/chat-conversation',
        //     component: () => import("../view/ChatConversation"),
        // },
        // {
        //     path: '*',
        //     redirect: "/"
        // }
    ]
});
